/*
 * TDistribution.h
 *
 *  Created on: Feb 13, 2012
 *      Author: nhatuan
 *
 *
 *  This class stores information of a t-distribution
 *  @param data: a vector of samples
 *  @param correlationMatrix: the correlation matrix between x,y intensities of samples in this distribution
 *  @param inverseMatrix: the inverse matrix of correlation matrix
 *  @param locationParameters: the location parameters of distribution
 *  @param degreeOfFreedom: the degree of freedom of distribution
 *  @param determinant: the determinant of inverseMatrix
 */
#ifndef TDISTRIBUTION_H_
#define TDISTRIBUTION_H_

#include "Sample.h"
#include <vector>
#include "../MathProcesses.h"
#include <fstream>

using namespace std;

class TDistribution {
public:

	TDistribution();
	//TDistribution(TDistribution&);
	virtual ~TDistribution();
	float ** getArrayData();
	void calculateEssentialData();
	float calculateProb(float x, float y);
	float * calculateProbArray(float *x, float *y);
	bool removeASample(string sampleName);
	void addASample(Sample s);
	void setDegreeOfFreedom(int dg);
	int getSize();
	float getDeterminant() {return determinant;};
	float getDegreeOfFreeDom() {return degreeOfFreedom;};
	void save(ofstream &ofs);
	void load(ifstream &ifs);
private:
	vector<Sample> data;
	int degreeOfFreedom;
	float ** inverseMatrix;
	float ** correlationMatrix;
	float * locationParameters;
	float determinant;
};

#endif /* TDISTRIBUTION_H_ */
